package com.songlanyun.modules.publicbenefitmsg.model;

import com.songlanyun.common.drive.ValueObject;
import com.songlanyun.common.enums.DonationConstant;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;

/**
 * 购买消息
 *
 * @author EDY
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class BuyMsg implements ValueObject, IPublicBenefitMsgBody {

    /**
     * 操作类型
     */
    private DonationConstant.BuyMsgType modelType;
//    /**
//     * 捐赠ID
//     */
//    private Long modelId;
    /**
     * 商品ID
     */
    private Long goodsId;
    /**
     * 商品标题
     */
    private String goodsTitle;
    /**
     * 商品图片
     */
    private String goodsCover;
    /**
     * 商品金额
     */
    private BigDecimal goodsAmount;

    public void setModelType(Integer modelType) {
        this.modelType = DonationConstant.BuyMsgType.getByCode(modelType);
    }
}
